#include<iostream>
#include<vector>
using namespace std;

class Solution {
    public:
        vector<int> twoSum(vector<int> nums, int target) {
            // 两层循环
            for (int i = 0; i < nums.size(); i++) {
                for (int j = i + 1; j < nums.size(); j++) {
                    if (target == nums[i] + nums[j]) {
                        vector<int> result;
                        result.push_back(i);
                        result.push_back(j);
                        return result;
                    } // if
                } // for
            } // for end
        }
};

int main() {
    vector<int> nums; // 测试数组
    vector<int> rec; // 接收数组
    // 初始化测试数组
    nums.push_back(2);
    nums.push_back(7);
    nums.push_back(11);
    nums.push_back(15);
    Solution solution;
    rec = solution.twoSum(nums, 9);
    cout << nums[0] << "," << nums[1];
    cout << "Test Success"<< endl;
    return 0; 
}